find a polynomial of given degree